const path = require('path');

module.exports = {
  css: {
    extract: false,     
    sourceMap: true      
  },
  
  configureWebpack: {
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src')
      }
    }
  },

  chainWebpack: config => {
    config.module
      .rule('vue')
      .use('vue-loader')
      .tap(options => {
        options.cacheDirectory = false;
        return options;
      });
  },

  devServer: {
    headers: {
      'Content-Type': 'text/html; charset=utf-8'
    },
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true
      }
    }
  }
};